Use packages to prevent React v15.5.0 and up from complaining about deprecated API's#38
Use packages to prevent React v15.5.0 and up from complaining about deprecated API's#38gaearon merged 3 commits intogaearon:masterfrom
Conversation
…ut deprecated API's.
| }, | ||
| "dependencies": { | ||
| "create-react-class": "^15.5.1", | ||
| "prop-types": "^15.5.6", |
There was a problem hiding this comment.
Shouldn't it be in peerDependencies ?
There was a problem hiding this comment.
I'm not sure. I guess you would pull in react as a peer dependency as users would actively want to provide their own copy of it, but is that the case with these two? react they definitely would have installed anyway, but might not use prop-types or create-react-class, which they then have to install manually and include in their project dependencies (as it goes with peerDependencies). Can you explain why you think they should be peerDependencies?
There was a problem hiding this comment.
but might not use prop-types or create-react-class
I guess it's true
Can you explain why you think they should be peerDependencies?
I just don't think that this lib is big enough to be "batteries included" type.
Anyways I guess @gaearon does not have time or ambitions to maintain this project, so it's time to move on.
There was a problem hiding this comment.
No, it should be in dependencies.
I'm happy to add maintainers who won't change the API (I don't think it's worth changing it at this point to avoid churn in a very simple library). If you'd like to help with maintenance let me know.
gaearon
left a comment
There was a problem hiding this comment.
Let's either introduce Babel here or rewrite this in prototype style (e.g. type Babel loose mode-like output by hand). I don't want this to depend on create-react-class.
|
@gaearon fair enough on not wanting to rely on |
|
@gaearon how about this? Seemed the simplest way to create the component prototypally (stateless functions won't work because returning I also removed |
| }, | ||
| "homepage": "https://github.com/gaearon/react-document-title", | ||
| "devDependencies": { | ||
| "create-react-class": "^15.5.2", |
|
LGTM |
|
Out in 2.0.3, thanks! |
To prevent React
>=15.5.0from throwing warnings we can't useReact.createClassorReact.PropTypesdirectly. For both there are now separate packages on npm. In case ofcreateClassthe recommendation is to convert to a ES6 class, however that's a bit more of an involved change. Instead, I reckon we can get this version out and silence those warnings first and then tackle a conversion to ES6 class separately.Note: linter and all tests pass, but a warning is thrown by React during tests about calling a used PropType directly. However, I can't seem to figure out why, so it's probably caused by
react-side-effect?